#pragma once

#include "Stats.h"
#include "Actor.h"

enum SkillType
{
	SKILL_STAT = 0,
	SKILL_REWARD = 1,
	SKILL_SPECIAL = 2,
	SKILL_COMBO = 3
};

enum SkillBranch
{
	SKILL_MELEE = 0,
	SKILL_RANGED = 1,
	SKILL_HEALTH = 2,
	SKILL_ENERGY = 3
};

struct Skill
{
	Skill(const std::string name = "", 
		  const int tier = 0,
		  const int rank = 0,
		  const bool skillable = false,
		  const SkillType type = SKILL_STAT,
		  const SkillBranch branch = SKILL_MELEE,
		  const std::string description = "no description available")
	: name(name), tier(tier), rank(rank), skillable(skillable), type(type), branch(branch), description(description) { }

	std::string name;
	int tier;
	int rank;
	bool skillable;
	SkillType type;
	SkillBranch branch;
	std::string description;
};

class SkillTree {

public:
	SkillTree(Actor* owner);
	~SkillTree();

	Actor* getOwner();
	boost::shared_ptr<Skill> getSkillTable();

	void purchaseSkill(int tier, int branch);
	void resetTree();

private:
	void readSkillTreeFromXML();

	Actor* mpOwner;
	boost::shared_ptr<Skill> mpSkillTable[4][5];
};